-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Lily58 to use split_common #6260
Conversation
…e default to match
I'll test encoder functionality, backlighting, and anything else I can think of, and report back with any issues I find. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be blunt, it may be much better to move the OLED code all into the keymap.c file, so that it's accessible and editable there, rather than relying on the "lib" stuff.
This is especially true of the layer code.
Also, why not 270 degree rotation? :)
If this is like the helix, I think you have to cut a trace (between two pads), and add 2x resistors on one of the sides for it to work properly. Additionally, you can't have OLED's on both sides in this case, since they use the same i2c address, which is a big no-no. |
|
@MysticMixles
|
I just added OLED_DRIVER_ENABLE= yes to my rules.mk, but both OLEDs are still turned off.
This is the code I'm using and it works, assuming the encoder is on the master side - the main branch's custom split code doesn't let an encoder work on the slave side at all, as far as I can tell.
I didn't realize that rgblight wasn't enabled by default, I just turned it on and it works. However, if I call rgblight_sethsv, I still get errors that it hasn't been defined. |
Also, the RGB only works on the master side of the keyboard - whatever side I plug the usb cable into lights up, and the other side is dark. |
Looking at the code, I'm not super familiar with QMK, but I actually don't see where the OLED gets turned on - in the main branch there is a #define SSD1306OLED, and in the keymap code there is some OLED code, and in this branch there isn't any - I don't know if this is causing the issue, or just because of the split common changes, but it is the first thing I jumped to. |
Oh, and for installing the encoder, I used these, and bent all of the pins to be flat with the pcb, other than the mounting legs, which I put into the holes that a PCB mount switch would use. This holds pretty tight, and probably isn't great for the keyboard if you reinstall several times, but works fine for me. |
@MysticMixles I believe that for the SSD1306 type code, it gets turned on by keypress, and statup. |
Then it is broken - when I flashed the main branch the screens worked as expected |
Well, for the OLED Driver feature, it runs it from keyboard_task, and is triggered by a matrix change. That's why it doesn't work right on the non-split common stuff. |
As long as
Typically you would wire the RGBs the other way round, and have the LED data pin be wired to the unused TRRS connector, so that the master would do all the work of controlling the RGBs. In this case, since you've wired the data pin on both sides to the pro micro, you would probably need to enable Disclaimer: my lily58 isn't wired with RGBs so I have no way of testing this, but I have gotten the same setup working with an iris split keyboard. re: the encoders, still trying to get encoders working with my keyboard. I'll keep you updated. |
Actually, according to this thread, if your encoder is on the slave side you should change the index to 1 (or if you have just one encoder, get rid of the index-checking altogether and just have:
|
@yyc The encoder doesn't work on either side of the keyboard, using the default keymap with that bit of code added and encoders enabled. I haven't tried the no index method, but it doesn't work on the master side with an index of either 1 or 0. I'll play with RGB_SPLIT in a few hours to see if that works. Regarding the OLEDs, using the default keymap they don't appear to work. |
I still can't call rgblight_sethsv - it is undefined, even after adding RGB_SPLIT. Also, using the index-less encoder code, it doesn't work either. And I'm unclear as to what's going on with the OLEDs - are they supposed to work, or do I need to change things? They don't turn on using the default keymap. |
@MysticMixles
Can you upload a copy of your repo?
I've tested the split encoder code individually and it seems to work but not when I plug everything in so I'm not sure whether there's something wrong with my testing setup or whether there's some low-level issue that I'm not thinking of :/
OLEDs should work immediately when you flash with the default keymap. |
If I have some time later today, I'll give this a try, I have the lily58 pro with oleds and there's an rgb strip but it's not wired up at the moment. |
keyboards/lily58/lib/glcdfont_lily.c
Outdated
@@ -1,6 +1,10 @@ | |||
// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. | |||
// See gfxfont.h for newer custom bitmap font info. | |||
|
|||
// Modified to show the Lily58 logo instead of the qmk logo | |||
|
|||
#pragma once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have never known #pragma once
to be used in a .c
file 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¯\(ツ)/¯
was requested by drashna in #6260 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well this is used in an #include
by the OLED driver, should not be a problem to rename it to .h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drashna 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flashed the default keymap from this branch to some Pro Micros. Don't have the actual PCB or the hardware to emulate this board, so __attribute__ ((weak))
✔️ because the only thing I can test is that it works as a keyboard.
Co-authored-by: Ryan <fauxpark@gmail.com>
Looks good to me. @yyc Fantastic work on the changelog entry. ❤️ |
Thanks! |
* Refactor core keyboard files to use split_common * Refactor OLED libs for compatibility with split_common * Override default glcd font to get lily58 logo * Switch to OLED library, clean up references to SSD1306OLED, and update default to match * Remove duplicated #define tapping_term * Add in logo_reader that was accidentally deleted * fix yuchi keymap as well to get CI passing * remove serial_config * keyboards/lily58/lib/layer_state_reader.c * incorporate layer changes * add my own lily58 keymap * incorporate suggestions and fix CI warnings * Remove reference to SSD1306OLED in @ninjonas' build * Update ninjonas.c * fix build/import issues * update km * update debounce * update DIODE_DIRECTION * address comments * address comments * add Changelog * Apply suggestions
* Refactor core keyboard files to use split_common * Refactor OLED libs for compatibility with split_common * Override default glcd font to get lily58 logo * Switch to OLED library, clean up references to SSD1306OLED, and update default to match * Remove duplicated #define tapping_term * Add in logo_reader that was accidentally deleted * fix yuchi keymap as well to get CI passing * remove serial_config * keyboards/lily58/lib/layer_state_reader.c * incorporate layer changes * add my own lily58 keymap * incorporate suggestions and fix CI warnings * Remove reference to SSD1306OLED in @ninjonas' build * Update ninjonas.c * fix build/import issues * update km * update debounce * update DIODE_DIRECTION * address comments * address comments * add Changelog * Apply suggestions
Pursuant qmk/qmk_firmware#6260 Update to take advantage of refactor (and OLED driver). Next up: - Figure out custom logo - Work on OLED configuration
* Refactor core keyboard files to use split_common * Refactor OLED libs for compatibility with split_common * Override default glcd font to get lily58 logo * Switch to OLED library, clean up references to SSD1306OLED, and update default to match * Remove duplicated #define tapping_term * Add in logo_reader that was accidentally deleted * fix yuchi keymap as well to get CI passing * remove serial_config * keyboards/lily58/lib/layer_state_reader.c * incorporate layer changes * add my own lily58 keymap * incorporate suggestions and fix CI warnings * Remove reference to SSD1306OLED in @ninjonas' build * Update ninjonas.c * fix build/import issues * update km * update debounce * update DIODE_DIRECTION * address comments * address comments * add Changelog * Apply suggestions
* Branch point for 2020 May 30 Breaking Change * Migrate `ACTION_LAYER_TOGGLE` to `TG()` (#8954) * Migrate `ACTION_MODS_ONESHOT` to `OSM()` (#8957) * Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (#8958) * Migrate `ACTION_LAYER_MODS` to `LM()` (#8959) * Migrate `ACTION_MODS_TAP_KEY` to `MT()` (#8968) * Convert V-USB usbdrv to a submodule (#8321) * Unify Tap Hold functions and documentation (#8348) * Changing board names to prevent confusion (#8412) * Move the Keyboardio Model01 to a keyboardio/ subdir (#8499) * Move spaceman keyboards (#8830) * Migrate miscellaneous `fn_actions` entries (#8977) * Migrate `ACTION_MODS_KEY` to chained mod keycodes (#8979) * Organizing my keyboards (plaid, tartan, ergoinu) (#8537) * Refactor Lily58 to use split_common (#6260) * Refactor zinc to use split_common (#7114) * Add a message if bin/qmk doesn't work (#9000) * Fix conflicting types for 'tfp_printf' (#8269) * Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (#6480) * Refactor and updates to TKC1800 code (#8472) * Switch to qmk forks for everything (#9019) * audio refactor: replace deprecated PLAY_NOTE_ARRAY (#8484) * Audio enable corrections (2/3) (#8903) * Split HHKB to ANSI and JP layouts and Add VIA support for each (#8582) * Audio enable corrections (Part 4) (#8974) * Fix typo from PR7114 (#9171) * Augment future branch Changelogs (#8978) * Revert "Branch point for 2020 May 30 Breaking Change"
* Branch point for 2020 May 30 Breaking Change * Migrate `ACTION_LAYER_TOGGLE` to `TG()` (qmk#8954) * Migrate `ACTION_MODS_ONESHOT` to `OSM()` (qmk#8957) * Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (qmk#8958) * Migrate `ACTION_LAYER_MODS` to `LM()` (qmk#8959) * Migrate `ACTION_MODS_TAP_KEY` to `MT()` (qmk#8968) * Convert V-USB usbdrv to a submodule (qmk#8321) * Unify Tap Hold functions and documentation (qmk#8348) * Changing board names to prevent confusion (qmk#8412) * Move the Keyboardio Model01 to a keyboardio/ subdir (qmk#8499) * Move spaceman keyboards (qmk#8830) * Migrate miscellaneous `fn_actions` entries (qmk#8977) * Migrate `ACTION_MODS_KEY` to chained mod keycodes (qmk#8979) * Organizing my keyboards (plaid, tartan, ergoinu) (qmk#8537) * Refactor Lily58 to use split_common (qmk#6260) * Refactor zinc to use split_common (qmk#7114) * Add a message if bin/qmk doesn't work (qmk#9000) * Fix conflicting types for 'tfp_printf' (qmk#8269) * Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (qmk#6480) * Refactor and updates to TKC1800 code (qmk#8472) * Switch to qmk forks for everything (qmk#9019) * audio refactor: replace deprecated PLAY_NOTE_ARRAY (qmk#8484) * Audio enable corrections (2/3) (qmk#8903) * Split HHKB to ANSI and JP layouts and Add VIA support for each (qmk#8582) * Audio enable corrections (Part 4) (qmk#8974) * Fix typo from PR7114 (qmk#9171) * Augment future branch Changelogs (qmk#8978) * Revert "Branch point for 2020 May 30 Breaking Change"
* Branch point for 2020 May 30 Breaking Change * Migrate `ACTION_LAYER_TOGGLE` to `TG()` (qmk#8954) * Migrate `ACTION_MODS_ONESHOT` to `OSM()` (qmk#8957) * Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (qmk#8958) * Migrate `ACTION_LAYER_MODS` to `LM()` (qmk#8959) * Migrate `ACTION_MODS_TAP_KEY` to `MT()` (qmk#8968) * Convert V-USB usbdrv to a submodule (qmk#8321) * Unify Tap Hold functions and documentation (qmk#8348) * Changing board names to prevent confusion (qmk#8412) * Move the Keyboardio Model01 to a keyboardio/ subdir (qmk#8499) * Move spaceman keyboards (qmk#8830) * Migrate miscellaneous `fn_actions` entries (qmk#8977) * Migrate `ACTION_MODS_KEY` to chained mod keycodes (qmk#8979) * Organizing my keyboards (plaid, tartan, ergoinu) (qmk#8537) * Refactor Lily58 to use split_common (qmk#6260) * Refactor zinc to use split_common (qmk#7114) * Add a message if bin/qmk doesn't work (qmk#9000) * Fix conflicting types for 'tfp_printf' (qmk#8269) * Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (qmk#6480) * Refactor and updates to TKC1800 code (qmk#8472) * Switch to qmk forks for everything (qmk#9019) * audio refactor: replace deprecated PLAY_NOTE_ARRAY (qmk#8484) * Audio enable corrections (2/3) (qmk#8903) * Split HHKB to ANSI and JP layouts and Add VIA support for each (qmk#8582) * Audio enable corrections (Part 4) (qmk#8974) * Fix typo from PR7114 (qmk#9171) * Augment future branch Changelogs (qmk#8978) * Revert "Branch point for 2020 May 30 Breaking Change"
* Branch point for 2020 May 30 Breaking Change * Migrate `ACTION_LAYER_TOGGLE` to `TG()` (qmk#8954) * Migrate `ACTION_MODS_ONESHOT` to `OSM()` (qmk#8957) * Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (qmk#8958) * Migrate `ACTION_LAYER_MODS` to `LM()` (qmk#8959) * Migrate `ACTION_MODS_TAP_KEY` to `MT()` (qmk#8968) * Convert V-USB usbdrv to a submodule (qmk#8321) * Unify Tap Hold functions and documentation (qmk#8348) * Changing board names to prevent confusion (qmk#8412) * Move the Keyboardio Model01 to a keyboardio/ subdir (qmk#8499) * Move spaceman keyboards (qmk#8830) * Migrate miscellaneous `fn_actions` entries (qmk#8977) * Migrate `ACTION_MODS_KEY` to chained mod keycodes (qmk#8979) * Organizing my keyboards (plaid, tartan, ergoinu) (qmk#8537) * Refactor Lily58 to use split_common (qmk#6260) * Refactor zinc to use split_common (qmk#7114) * Add a message if bin/qmk doesn't work (qmk#9000) * Fix conflicting types for 'tfp_printf' (qmk#8269) * Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (qmk#6480) * Refactor and updates to TKC1800 code (qmk#8472) * Switch to qmk forks for everything (qmk#9019) * audio refactor: replace deprecated PLAY_NOTE_ARRAY (qmk#8484) * Audio enable corrections (2/3) (qmk#8903) * Split HHKB to ANSI and JP layouts and Add VIA support for each (qmk#8582) * Audio enable corrections (Part 4) (qmk#8974) * Fix typo from PR7114 (qmk#9171) * Augment future branch Changelogs (qmk#8978) * Revert "Branch point for 2020 May 30 Breaking Change"
* Branch point for 2020 May 30 Breaking Change * Migrate `ACTION_LAYER_TOGGLE` to `TG()` (qmk#8954) * Migrate `ACTION_MODS_ONESHOT` to `OSM()` (qmk#8957) * Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (qmk#8958) * Migrate `ACTION_LAYER_MODS` to `LM()` (qmk#8959) * Migrate `ACTION_MODS_TAP_KEY` to `MT()` (qmk#8968) * Convert V-USB usbdrv to a submodule (qmk#8321) * Unify Tap Hold functions and documentation (qmk#8348) * Changing board names to prevent confusion (qmk#8412) * Move the Keyboardio Model01 to a keyboardio/ subdir (qmk#8499) * Move spaceman keyboards (qmk#8830) * Migrate miscellaneous `fn_actions` entries (qmk#8977) * Migrate `ACTION_MODS_KEY` to chained mod keycodes (qmk#8979) * Organizing my keyboards (plaid, tartan, ergoinu) (qmk#8537) * Refactor Lily58 to use split_common (qmk#6260) * Refactor zinc to use split_common (qmk#7114) * Add a message if bin/qmk doesn't work (qmk#9000) * Fix conflicting types for 'tfp_printf' (qmk#8269) * Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (qmk#6480) * Refactor and updates to TKC1800 code (qmk#8472) * Switch to qmk forks for everything (qmk#9019) * audio refactor: replace deprecated PLAY_NOTE_ARRAY (qmk#8484) * Audio enable corrections (2/3) (qmk#8903) * Split HHKB to ANSI and JP layouts and Add VIA support for each (qmk#8582) * Audio enable corrections (Part 4) (qmk#8974) * Fix typo from PR7114 (qmk#9171) * Augment future branch Changelogs (qmk#8978) * Revert "Branch point for 2020 May 30 Breaking Change"
* Branch point for 2020 May 30 Breaking Change * Migrate `ACTION_LAYER_TOGGLE` to `TG()` (qmk#8954) * Migrate `ACTION_MODS_ONESHOT` to `OSM()` (qmk#8957) * Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (qmk#8958) * Migrate `ACTION_LAYER_MODS` to `LM()` (qmk#8959) * Migrate `ACTION_MODS_TAP_KEY` to `MT()` (qmk#8968) * Convert V-USB usbdrv to a submodule (qmk#8321) * Unify Tap Hold functions and documentation (qmk#8348) * Changing board names to prevent confusion (qmk#8412) * Move the Keyboardio Model01 to a keyboardio/ subdir (qmk#8499) * Move spaceman keyboards (qmk#8830) * Migrate miscellaneous `fn_actions` entries (qmk#8977) * Migrate `ACTION_MODS_KEY` to chained mod keycodes (qmk#8979) * Organizing my keyboards (plaid, tartan, ergoinu) (qmk#8537) * Refactor Lily58 to use split_common (qmk#6260) * Refactor zinc to use split_common (qmk#7114) * Add a message if bin/qmk doesn't work (qmk#9000) * Fix conflicting types for 'tfp_printf' (qmk#8269) * Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (qmk#6480) * Refactor and updates to TKC1800 code (qmk#8472) * Switch to qmk forks for everything (qmk#9019) * audio refactor: replace deprecated PLAY_NOTE_ARRAY (qmk#8484) * Audio enable corrections (2/3) (qmk#8903) * Split HHKB to ANSI and JP layouts and Add VIA support for each (qmk#8582) * Audio enable corrections (Part 4) (qmk#8974) * Fix typo from PR7114 (qmk#9171) * Augment future branch Changelogs (qmk#8978) * Revert "Branch point for 2020 May 30 Breaking Change"
Now that
split_common
is pretty mature, it might be a good idea to get rid of all the duplicated functionality and just use the common libraries so we can piggyback on those updates.Description
This removes the duplicated code (matrix.c, split_util.c, etc.), and updates the build files to automatically include the split_common files.
Then, the OLED code is refactored to use the core OLED library, so we can remove ssd1306.c as well. All the widgets are also updated for compatibility with the new core OLED library. The default keymap has also been updated to work with the core and OLED libraries. For a guide on how to update your own keymap for compatibility, take a look at the default keymap refactor.
This is tested to work with two halves communicating over serial, with i2c communication on both OLEDs. (sidenote: does i2c over the two halves even work? I couldn't get it to work even with the original repo)
My build doesn't have ws2812 underlighting, so I'm unable to test whether that's working. Help on that would be appreciated.
Types of Changes
Checklist